# -*- coding:utf-8 -*-
# @FileName  :per_rule.py
# @Time      :2020/12/10 10:36
# @Author    :Zhoujirong
# @Desc      :

from common.http_request import Request
from biz.support.urls import ServerUrl

class PerRuleRequest:
    '''异常查询阻断'''
    @classmethod
    def detail(cls,id,cookie):
        data = {
            'id':id
        }
        req = Request(ServerUrl.per_rule_detail_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def get_page(cls,curPage,
                        maxSize,
                        search_EQ_ruleCode,
                        search_LIKE_ruleName,
                        search_EQ_pageControl,
                        search_EQ_interfaceControl,
                        search_EQ_lockUser,
                        search_EQ_stopFlag,
                        EQ_queryNum,cookie):
        params = {
            'curPage':curPage,
            'maxSize':maxSize,
            'search_EQ_ruleCode':search_EQ_ruleCode,
            'search_LIKE_ruleName':search_LIKE_ruleName,
            'search_EQ_pageControl':search_EQ_pageControl,
            'search_EQ_interfaceControl':search_EQ_interfaceControl,
            'search_EQ_lockUser':search_EQ_lockUser,
            'search_EQ_stopFlag':search_EQ_stopFlag,
            'EQ_queryNum':EQ_queryNum
        }
        req = Request(ServerUrl.per_rule_getpage_url,params=params,headers=cookie)
        return req.get()

    @classmethod
    def start_stop(cls,id,stopFlag,cookie):
        data = {
            'id':id,
            'stopFlag':stopFlag
        }
        req = Request(ServerUrl.per_rule_start_stop_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def update(cls,comments,
                    controlMode,
                    deptCode,
                    ext1,
                    ext2,
                    ext3,
                    ext4,
                    ext5,
                    ext6,
                    id,
                    interfaceControl,
                    lockUser,
                    pageControl,
                    resCode,
                    resMsg,
                    ruleCode,
                    ruleDescribe,
                    ruleName,
                    ruleValue1,
                    ruleValue2,
                    ruleValue3,
                    ruleValue4,
                    serialNumber,
                    stopFlag,cookie):
        data = {
            'comments':comments,
            'controlMode':controlMode,
            'deptCode':deptCode,
            'ext1':ext1,
            'ext2':ext2,
            'ext3':ext3,
            'ext4':ext4,
            'ext5':ext5,
            'ext6':ext6,
            'id':id,
            'interfaceControl':interfaceControl,
            'lockUser':lockUser,
            'pageControl':pageControl,
            'resCode':resCode,
            'resMsg':resMsg,
            'ruleCode':ruleCode,
            'ruleDescribe':ruleDescribe,
            'ruleName':ruleName,
            'ruleValue1':ruleValue1,
            'ruleValue2':ruleValue2,
            'ruleValue3':ruleValue3,
            'ruleValue4':ruleValue4,
            'serialNumber':serialNumber,
            'stopFlag':stopFlag
        }
        req = Request(ServerUrl.per_rule_update_url,data=data,headers=cookie)
        return req.post()



if __name__ == "__main__":
    pass